package com.example.myapplication.part7;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.R;

public class Part701Activity extends AppCompatActivity {
    private EditText editTextResult;
    private EditText editTextName;
    private EditText editTextStudentId;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_part701); // 替换为你的布局文件名

        // 初始化控件
        editTextResult = findViewById(R.id.editTextResult);
        editTextName = findViewById(R.id.editTextName);
        editTextStudentId = findViewById(R.id.editTextStudentId);
        Button btnSubmit = findViewById(R.id.btnSubmit);

        // 设置按钮点击事件
        btnSubmit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 获取姓名和学号的输入内容
                String name = editTextName.getText().toString();
                String studentId = editTextStudentId.getText().toString();

                // 将内容显示到结果文本框中
                editTextResult.setText("姓名: " + name + "\n学号: " + studentId);
            }
        });
    }
}